<!DOCTYPE html>
<html lang="en">
<head>
    <title>滚滚向前投票助手</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <!--<link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">-->
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <!--<link rel="stylesheet" href="/dist/css/OA.min.css?t=4a6c1b54">-->
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
    <style>
        [v-cloak] {
            display: none;
        }
        input:focus {
            　　font-size: 16px !important;
        }
        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            outline: none;
        }

        body {
            background: #fff;
        }

        .tijiaoBtn {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 50px;
            line-height: 50px;
            background: #2a8cec;
            color: #fff;
            text-align: center;
            font-weight: bold;
            font-size: 16px;
            z-index: 9999999;
        }
        .noFj{
            text-align: center;
            font-size: 20px;
            color:#aaa;
            margin-top: 150px;
        }
    </style>
</head>
<body>
<section class="content" id="app" style="padding: 0px;" v-cloak>
    <div class="noFj">您尚未上传参投文件，请尽快上传！</div>

    <div class="tijiaoBtn" @click="goAdd" >上传参投文件</div>
</section>
<!--JQ-->
<script src="/dist/plugins/scroll/jquery-2.1.4.min.js"></script>
<script src="/dist/plugins/jQuery/jquery.cookie.min.js"></script>
<script src="/dist/js/oaApp.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>

<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">

    var app = new Vue({
        el: '#app',
        data: {
            userInfo:{},
            userId: getUrlParamObj().userId,
            mainId:getUrlParamObj().mainId,
            name:getUrlParamObj().name,
            title:getUrlParamObj().title
        },
        methods: {
            goAdd:function () {
                var that = this
                JSBridge.call(FILE, 'uploadFile',{},function (res) {
                    var data = res.sendData;
                    if(data.url){
                        $.wyui.postMethod('/vote/updateVoteTheme.json', {mainId: that.mainId,description:that.name,attrUrl:data.url,attrName:data.name}, function (data) {
                            console.log(data)
                            if(data.id=='true'){
                                JSBridge.call(UI, 'showToast', {title: "上传成功！"})
                                var param = {
                                    backRefresh: false,       //是否返回刷新
                                }
                                JSBridge.call(ROUTER, 'navigateBack', param)

                                    var url='/page/voteApp/detail.html?mainId='+that.mainId+"&userId="+that.userId+"&name="+that.name+"&scfj=true";
                                    var param = {
                                        screenType: '0',        //默认竖屏0, 横屏1
                                        title: that.title,         //顶部标题
                                        url: url, //路径
                                        showTitleBar: false,     //是否显示标题栏
                                        enableRefresh: false,   //是否启用下拉刷新
                                        backRefresh: true       //是否返回刷新
                                    }
                                    JSBridge.call(ROUTER, 'navigateTo', param)

                            }
                        })
                    }

                })
            }

        },
        mounted: function () {
            var that=this;

        }
    });

</script>
<script>
    //禁用返回键后,点击app返回键回调
    function onBackPressed(enableNavigateBack) {
//        JSBridge.call(UI, 'refresh')
    }
</script>

</body>